package com.song.provider.service.impl;

import com.alibaba.csp.sentinel.annotation.SentinelResource;
import com.alibaba.csp.sentinel.slots.block.BlockException;
import com.song.provider.service.UserService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

/**
 * @Author 宋伟宁
 * @Date 2024/1/9
 * @Version 1.0
 **/
@Service
@Slf4j
public class UserServiceImpl implements UserService {
    @Override
    @SentinelResource(value = "getUser",blockHandler = "testGetuser")
    public String getUser() {
        log.info("链路流控：user service getUser");
        return "user service getUser";
    }
    public String testGetuser(BlockException e) {
        log.debug("进入了流控！");
        return "链路流控";

    }
}
